<%--                                                                       --%>
<%-- Copyright (c) 2004 BroadVision, Inc.  All rights reserved.            --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

<script language="JavaScript">

  function doSaveAction(theForm){
  var theName = theForm.name.value;
  var theScriptPath = theForm.scriptPath.value;
  theForm.name.value = theName.stringTrim();
  theForm.scriptPath.value = theScriptPath.stringTrim();
  
    if(validateRequiredField(theForm) == false) return false;
    return true;
  }


  function doCancelAction(theForm) {
    theForm.action='<c:url value="/ep/micrositeTemplateList.do"/>';
    theForm.submit();
    return;
  }

</script>

<html-el:javascript formName="/ep/micrositeTemplateSave" method="validateRequiredField"/>

<html-el:form action="/ep/micrositeTemplateSave.do" focus="name" onsubmit="return doSaveAction(epMicrositeTemplateEditForm);">
<html-el:hidden property="micrositeTemplateId" value="${epMicrositeTemplateEditForm.map.id}" />
<html-el:hidden property="instanceCount" value="${epMicrositeTemplateEditForm.map.instanceCount}" />
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">   
        <c:choose>
          <c:when test="${epMicrositeTemplateEditForm.map.id == 0}">
            <bean-el:message key="ep.microsite.templates.create.page.title" bundle="ep.messages"/>
          </c:when>
          <c:otherwise>
            <bean-el:message key="ep.microsite.templates.edit.page.title" arg0="${epMicrositeTemplateEditForm.map.name}" bundle="ep.messages"/>
          </c:otherwise>
        </c:choose> 
      </div>
      
      <div class="errorMessage"><html-el:errors bundle="ep.messages"/></div>
      <%@ include file="/mc/common/pagetab.jsp" %>
      <div class="pageSubtitle">
        <span class="left">
          <bean-el:message key="ep.microsite.templates.information" bundle="ep.messages"/>
        </span>
        <span class="right">&nbsp;</span>
      </div> 
      <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
        <tr> 
          <td class="label" width="30%">
            <bean-el:message key="ep.microsite.templates.detail.label.name" bundle="ep.messages"/>:*
          </td>
          <td class="labelField" width="70%">
            <html-el:text property="name" size="30" maxlength="80"/> 
          </td>
        </tr>
        <tr> 
          <td class="label" width="30%">
            <bean-el:message key="ep.microsite.templates.detail.label.actionHandler" bundle="ep.messages"/>:*
          </td>
          <td class="labelField" width="70%">
        <c:choose>
        <c:when test="${epMicrositeTemplateEditForm.map.id == 0}">
          <html-el:text property="scriptPath" size="30" maxlength="80"/>
        </c:when>
        <c:otherwise>
          <html-el:hidden property="scriptPath"/><c:out value="${epMicrositeTemplateEditForm.map.scriptPath}"/>
        </c:otherwise>
      </c:choose>
          </td>
        </tr>   
        <tr>
          <td class="label" width="30%">
            <bean-el:message key="ep.microsite.templates.detail.label.phase" bundle="ep.messages"/>:
          </td>
          <td class="labelField" width="70%">
            <c:choose>
              <c:when test="${epMicrositeTemplateEditForm.map.id == 0}">
                <html-el:checkbox property="phaseFlag"/>
              </c:when>
              <c:otherwise>
                <!-- Both IE 6.0 and Firefox 1.0 do not honor "readonly". -->
                <!-- Both IE 6.0 and Firefox 1.0 do not submit the form   -->
                <!-- input if "disabled" is used. Therefore, we use       -->
                <!-- javascript to make the checkbox read only.           -->
                <html-el:checkbox property="phaseFlag" onclick="return false"/>
              </c:otherwise>
            </c:choose>
          </td>         
        </tr>                     
        <tr> 
          <td class="label" width="30%">
            <bean-el:message key="ep.microsite.templates.detail.label.description" bundle="ep.messages"/>:
          </td>
          <td class="labelField" width="70%">
            <html-el:textarea property="description" rows="5" cols="50"/> 
          </td>
        </tr>
      </table>
      
      <div class="pageButtonWrap" align="right">
        <html-el:reset styleClass="pageButton" property="resetBtn">
          <bean-el:message key="button.reset" bundle="ep.messages"/>
        </html-el:reset>&nbsp;
        <input type="button" name="actionCancel" class="pageButton"
          onclick="doCancelAction(this.form);"
          value='<bean-el:message key="button.cancel" bundle="ep.messages"/>'/>
        <html-el:submit styleClass="pageButton" property="saveBtn">
          <bean-el:message key="button.save" bundle="ep.messages"/>
        </html-el:submit>
      </div>
    
    </td> 
  </tr>
</table>

</html-el:form> 

